Replication File for "How Exiles Mobilize Domestic Dissent" Journal of Politics, forthcoming.

By Elizabeth R. Nugent and Alexandra A. Siegel 


** Notes **

Last run by authors on macOS Monterey v 12.1
Rstudio verison 2023.06.0+421 
Running R version 4.3.0 

Working Directory will be automatically be set to location of EGExile_Replication folder when code files are run. 

We often use aggregated data to produce the figures and tables because Twitter, Crowdtangle, and Youtube terms of service prevent sharing the raw data and there are ethnical concerns due to the politically sensitive nature of our analysis. When datasets are at the tweet/post/video level, we include their ids. Contact authors for post/tweet ids to reproduce rehydrate complete Twitter and Facebook datasets. 


** Citation **

Elizabeth R. Nugent and Alexandra A. Siegel. 2024. "How Exiles Mobilize Domestic Dissent.” The Journal of Politics, forthcoming.

@article{NugentSiegel2024,
author = {Nugent, Elizabeth R. and Siegel, Alexandra A.},
journal = {The Journal of Politics},
title = {{How Exiles Mobilize Domestic Dissent}},
volume = {(forthcoming)},
year = {2024}
}


** Input Data **

 (in the "data" subdirectory)
 
1. youtube_data.csv
-- Dataset of every youtube video produced by Mo Ali (Sept 1 - Nov 1, 2019). Data collected using the Youtube API and tuber R package.

2. facebook_data.csv 
-- Aggregated data from collection of public Facebook posts referencing Mo Ali or his hashtags (September 1 - November 1, 2019). Data collected using the Crowdtangle API.

3. gtrends_panel.csv
-- Relative search volume of Mo Ali topic within Egypt and globally. Data collected using the gtrends R package. 

4. gtrends_egypt_map_city.csv
-- Relative search volume of Mo Ali topic in Egyptian cities. Data collected using the gtrends R package  

5. realtime_twitter_data.csv
-- Classified tweets referencing Egypt and Egyptian politics (September 1 - November 1, 2019). Data collected in real time with the Streaming API.

6. twitter_network_data.csv
-- K-core decomposition scores for unique users who mentioned Mo Ali in their tweets (September 1 - November 1, 2019). Scores calculated from dataset of all tweets mentioning Mo Ali's Twitter handle collected with the Academic API .

7. nodes_top100.csv and edges_top100.csv
-- Network data and metadata for top 100 users who most frequently mentioned Mo Ali (September 1 - November 1, 2019). Data filtered from dataset of all tweets mentioning Mo Ali's Twitter handle collected with the Academic API .

8. protest_data.csv
-- Dataset of daily protests by governorate (2010-2020). Data shared by Egyptian NGO Daftar Ahwall. 

9. human_coded_data.csv
-- Classified random sample of 1000 human coded tweets. Data sampled from realtime_twitter_data.csv 


** Code Files **

If R files are run, they will generate the figures and tables and save them into the "plots" and "tables" subdirectories

1. youtube_analysis.R
-- Produces all plots in manuscript using Youtube data (Figure 1a, Figure 2, Figure 6a, 6b, and 6c)

2. facebook_analysis.R
-- Produces all plots in manuscript using Facebook data (Figure 7a and 7b, Figure A5)

3. gtrends_analysis.R
-- Produces all plots and tables in manuscript using Google Trends data (Figure 8, Table A1) 

4. realtime_twitter_analysis.R
-- Produces all plots and tables in manuscript using realtime Twitter data (Figure 1b and 1c, Figure 5, Figure 9, Table A3) 

5. twitter_network_analysis.R 
-- Produces all plots in manuscript using k-core decomposition of Twitter network data (Figure 4, Figure A3, Figure A4)  

6. gephi_instructions.txt 
-- Instructions for how to make network visualizations in gephi (Figure 3)

7. protest_data_analysis.R
-- Produces figures and tables in manuscript using offline protest data (Figure A6, Table A2)

8. human_validation_analysis.R
-- Produces figure displaying results of human coding to validate measurement (Figure A1). 

